-----------------------------------------------------------
-- LUA Hearts of Iron 3 Germany File
-- Created By: Lothos
-- Modified By: Lothos
-- Date Last Modified: 5/14/2011
-----------------------------------------------------------

local P = {}
AI_BEL = P

function P.DiploScore_InviteToFaction(score, ai, actor, recipient, observer)
	-- Whatever their chance is lower it by 10 makes it harder to get them in
	return (score - 10)
end


-- Production Weights
--   1.0 = 100% the total needs to equal 1.0
function P.ProductionWeights(voProductionData)
	local laArray
	--Utils.LUA_DEBUGOUT("BEL total ic:" .. tostring(voProductionData.icTotal))
	

	if voProductionData.icTotal < 30 then
		laArray = {
			0.40, -- Land
			0.20, -- Air
			0.00, -- Sea
			0.40}; -- Other
	else
		laArray = {
			0.50, -- Land
			0.20, -- Air
			0.00, -- Sea
			0.30}; -- Other
	end

--[[
	if voProductionData.IsAtWar then
		laArray = {
			0.45, -- Land
			0.15, -- Air
			0.00, -- Sea
			0.40}; -- Other
	else
		laArray = {
			0.35, -- Land
			0.05, -- Air
			0.00, -- Sea
			0.60}; -- Other
	end
--]]
	
	return laArray
end



--Belgium defences
--btw Eben-Emael is already constructed in 1931-1935
function P.Build_Fort(ic, voProductionData, vbGoOver)
-- the closer to the top the higher priority is
	local year = CCurrentGameState.GetCurrentDate():GetYear()
	local month = CCurrentGameState.GetCurrentDate():GetMonthOfYear()
	
	ic = Support.Build_Fort(ic, voProductionData, 2312, 4, vbGoOver) -- Fortified Position of Liege
	ic = Support.Build_Fort(ic, voProductionData, 2369, 2, vbGoOver) -- Fortified Position of Namur

	if year >= 1940 then
--		ic = Support.Build_Fort(ic, ProductionData, 2254, 1, vbGoOver) -- Leuven
		ic = Support.Build_Fort(ic, ProductionData, 2369, 3, vbGoOver) -- Fortified Position of Namur
	elseif year >= 1939 then
		ic = Support.Build_Fort(ic, ProductionData, 2254, 1, vbGoOver) -- Leuven (bunker line along albert canal)
--		ic = Support.Build_Fort(ic, ProductionData, 10685, 1, vbGoOver) -- Turnhout
		ic = Support.Build_Fort(ic, ProductionData, 2312, 5, vbGoOver) -- Fortified Position of Liege (second call to make Namur to expand also)
		if(month >= 9) then
			ic = Support.Build_Fort(ic, ProductionData, 2311, 1, vbGoOver) -- K-W line - Brussels
		end
	elseif year >= 1938 then
		ic = Support.Build_Fort(ic, ProductionData, 2255, 1, vbGoOver) -- Hasselt
	end
	
--	if year >= 1937 then
--		ic = Support.Build_Fort(ic, ProductionData, 2254, 1, vbGoOver) -- Leuven - weak defence along Albert Canal
--	end
	
	return ic
end

-- END OF PRODUTION OVERIDES
-- #######################################

function P.CallLaw_training_laws(minister, voCurrentLaw)
	return CLawDataBase.GetLaw(29) -- _ADVANCED_TRAINING_
end

-- Belgium wont make an effort harder then _FULL_MOBILISATION_
--[[
function P.CallLaw_civil_law(ProductionData, voCurrentLaw)
	--local _FULL_CIVILIAN_ECONOMY_ = 11
	--local _BASIC_MOBILISATION_ = 12
	--local _FULL_MOBILISATION_ = 13
	--local _WAR_ECONOMY_ = 14
	--local _TOTAL_ECONOMIC_MOBILISATION_ = 15
	local minister = minister:GetCountry()
	local year = minister:GetOwnerAI():GetCurrentDate():GetYear()
	
	--loCurrentLaw:GetIndex() < 12
	if ministerCountry:IsAtWar() then
		return CLawDataBase.GetLaw(13)
	elseif (year > 1943) -- the war is over lets back to civilian ways. this should be based on threat level but dont know how to check
		return CLawDataBase.GetLaw(12)
	end
end
]]--
return AI_BEL